From 9935964b66a29f7ae2a70e6e142be589d3b2668f Mon Sep 17 00:00:00 2001 From: robertlipe Date: Tue, 23 Jul 2013 02:18:26 +0000 Subject: [PATCH] Integrate mapsend.cc.patch, microseconds-6.patch from Gerhard. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4470 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/csv_util.cc | 2 +- gpsbabel/mapsend.cc | 2 +- gpsbabel/util.cc | 8 +++++--- gpsbabel/vitosmt.cc | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gpsbabel/csv_util.cc b/gpsbabel/csv_util.cc index 32d20370d..0adcba66c 100644 --- a/gpsbabel/csv_util.cc +++ b/gpsbabel/csv_util.cc @@ -1182,7 +1182,7 @@ xcsv_parse_val(const char* s, waypoint* wpt, const field_map_t* fmp, int s_len = strlen(s); if (s_len < 4) { /* less than 1 epochsecond, an unusual case */ - wpt->SetCreationTime(0,(int) atoi(s)); + wpt->SetCreationTime(0, atoi(s)); } else { char buff[32]; int off = s_len - 3; diff --git a/gpsbabel/mapsend.cc b/gpsbabel/mapsend.cc index f479ec77a..d6a4b8a51 100644 --- a/gpsbabel/mapsend.cc +++ b/gpsbabel/mapsend.cc @@ -224,7 +224,7 @@ mapsend_track_read(void) } else { centisecs = 0; } - wpt_tmp->SetCreationTime(t, 10.0 * centisecs); + wpt_tmp->SetCreationTime(t, 10 * centisecs); track_add_wpt(track_head, wpt_tmp); } diff --git a/gpsbabel/util.cc b/gpsbabel/util.cc index 0a5a57fd8..52cd22c7e 100644 --- a/gpsbabel/util.cc +++ b/gpsbabel/util.cc @@ -925,13 +925,15 @@ month_lookup(const char *m) * that interesting to us anyway. */ #define EPOCH_TICKS 621355968000000000.0 -void dotnet_time_to_time_t(double dotnet, time_t *t, int *ms) +void dotnet_time_to_time_t(double dotnet, time_t *t, int *millisecs) { + // TODO: replace this with better interface with normal return values + // and called via a QDateTime. *t = (dotnet - EPOCH_TICKS) / 10000000.; #if LATER // TODO: work out fractional seconds. - if (ms) { - *ms = dotnet % 10000; + if (millisecs) { + *millisecs = dotnet % 10000; } #endif } diff --git a/gpsbabel/vitosmt.cc b/gpsbabel/vitosmt.cc index a7d46dcdc..fe4ea9557 100644 --- a/gpsbabel/vitosmt.cc +++ b/gpsbabel/vitosmt.cc @@ -169,7 +169,7 @@ vitosmt_read(void) tmStruct.tm_isdst =-1; double usec = fmod(1000000*seconds+0.5,1000000); - wpt_tmp->SetCreationTime(mkgmtime(&tmStruct),lround(usec/1000.0)); + wpt_tmp->SetCreationTime(mkgmtime(&tmStruct), lround(usec/1000.0)); wpt_tmp->shortname = (char*) xcalloc(16,1); snprintf(wpt_tmp->shortname, 15 , "WP%04d", ++serial); -- 2.30.2